package simple_factory_pattern.v4;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入数字A: ");
        String strNumberA = sc.next();
        System.out.print("请选择运算符号（+、-、*、/）: ");
        String strOperate = sc.next();
        System.out.print("请输入数字B: ");
        String strNumberB = sc.next();
        Operation operation = OperationFactory.createOperation(strOperate);
        double numberA = Double.parseDouble(strNumberA);
        double numberB = Double.parseDouble(strNumberB);
        operation.setNumberA(numberA);
        operation.setNumberB(numberB);
        System.out.println("结果是: " + operation.getResult());
    }
}
